/**
 * @file compass.h
 *
 */
#ifndef COMPASS_H
#define COMPASS_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_COMPASS != 0

/*********************
*      DEFINES
*********************/
#define WATCH_CHECK_COMPASS_DEGREE_PERIOD 1000
#define WATCH_COMPASS_W                   200
#define WATCH_COMPASS_H                   200
#define WATCH_COMPASS_H_OFFSET            -35
#define WATCH_COMPASS_IMG_W_OFFSET        -25
#define WATCH_COMPASS_IMG_H_OFFSET        20
#define WATCH_COMPASS_LABEL_H_OFFSET      30
/**********************
*      TYPEDEFS
**********************/
typedef struct
{
    lv_watch_obj_ext_t oldext;
    lv_obj_t * img_obj;
    lv_obj_t *label_obj;
    lv_obj_t *compass_cont2;
    uint8_t  var;
} lv_compass_ext_t;

/**********************
* GLOBAL PROTOTYPES
**********************/

/**********************
*      MACROS
**********************/
bool compass_read_req(uint16_t *degree); /* true: degree is valid,false: degree is invalid */
void compass_create_event_cb(lv_obj_t * btn, lv_event_t event);

#endif /*USE_LV_WATCH_COMPASS*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*COMPASS_H*/
